<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class kurikulum extends CI_Controller {
	
	var $objectid = 'kurikulum';
	
	function __construct(){
		parent::__construct();
		$this->load->model('sd/mdl_kurikulum');	
	}
	
	function index(){
		$data['objectid'] = $this->objectid;
		$this->load->view('sd/kurikulum', $data);
	}
	
	function grid(){
		//$data = $this->mdl_aspek_penilaian->get_data();
		echo $this->mdl_aspek_penilaian->togrid($data['row_data'], $data['row_count']);
	}
	
	function OptionTingkatByDep($kd_departemen){
		echo $this->mdl_prosedur->OptionTingkat(array('kd_departemen'=>$kd_departemen));
	}
	
	function OptionSemesterByTingkat($id_tingkat){
		echo $this->mdl_prosedur->OptionSemester(array('id_tingkat'=>$id_tingkat));
	}
	
	function OptionTemaBySemester($id_semester){
		echo $this->mdl_prosedur->OptionTema(array('id_semester'=>$id_semester));
	}
	
	function OptionSubtemaByTema($kd_tema){
		echo $this->mdl_prosedur->OptionSubtema(array('kd_tema'=>$kd_tema));
	}
	
	function load_jenisaspek(){
		$kd_subtema = $this->input->post('kd_subtema');
		if($kd_subtema != ''){
			$data = $this->mdl_kurikulum->getjenisaspek($kd_subtema);
			echo $this->mdl_kurikulum->togrid($data['row_data'], $data['row_count']);	
		}else{echo json_encode(array('total'=>0, 'rows'=>array('kd_jenisaspek'=>'')));}
	}
	
	function getjenisaspek($kd_subtema){
		$res = $this->mdl_kurikulum->get_JenisAspek($kd_subtema);
		echo json_encode(array('jenis_aspek'=>$res));
	}
	
}